home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / DEMOS / GTC-LM11.ZIP / SOURCE.ZIP / LM.ASM < prev    next >
Encoding:
Assembly Source File  |  1994-09-06  |  28.7 KB  |  820 lines

  1. comment $
  2.  
  3. █████ ████ █████▀████ █████▀████ █████▀████ ████▀████ ████ █████▀████ █████▀████
  4. █████ ████ █████ ████ █████ ████ █████ ████ ████ ████ ████ █████ ████ █████ ████
  5. █████ ████ █████ ▄▄▄▄ █████ ████ █████ ▄▄▄▄      ████ ████ █████ ████ █████ ████
  6. █████▀████ █████▀████ █████▀█▀▀▀ █████▀████      ████ ████ █████ ████ █████
  7. █████ ███▓ █████ ▄▄▄▄ █████ ███▓ █████ ▄▄▄▄      ███▓ ███▓ █████ ▄▄▄▄ █████████▓
  8. █████ ██▓▒ █████ ██▓▒ █████ ██▓▒ █████ ██▓▒      ██▓▒ ██▓▒ █████ ██▓▒ ▄▄▄▄▄ ██▓▒
  9. █████ █▓▒░ █████▄█▓▒░ █████ █▓▒░ █████▄█▓▒░      █▓▒░ █▓▒░ █████▄█▓▒░ █████▄█▓▒░
  10.                                                                              -cb
  11.  
  12.                          ∙■  H E R E T I C S  ' 9 4  ■∙
  13.  
  14.                                     present:
  15.  
  16.                       Liquid Metal BBS Advertisement v1.10
  17.  
  18.                              coded by Black Artist
  19.  
  20.                             a long, long time ago...
  21.  
  22.                         v1.10 updated 5th September 1994
  23.  
  24. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  25.  
  26.         erm..... make of this what you will - this was coded quite a while
  27.         ago and was left uncommented, when I went to update it I thought I
  28.         would release the source, but I can't be bothered to go through it
  29.         and comment it decently.  Some of the code is shocking, but for an
  30.         effect that is inherently so fast, even the sloppiest of code will
  31.         run at full frame rate.
  32.  
  33.         I hope this helps somebody LEARN.  However do not be so lame as to
  34.         try and simply RIP this code - if you are stupid enough to do so
  35.         and try and release something using even portions of this code and
  36.         call it your own, I will personally come and ram bugs down your
  37.         throat.  Actually, I wouldn't bother, because it's such a unique
  38.         effect (I haven't seen anything like it) and also so simple, that
  39.         everyone will laugh at you. (And the sky will turn green, the devil
  40.         will rise up and drag you down into the eternal pits of ..er...well
  41.         bad things will happen.) :)
  42.  
  43.         Well I'm sick of writing this so i will stop.
  44.  
  45.         btw for all you ppl in the USA, the 5/9/94 does NOT mean 9th May :)
  46.  
  47.  
  48.                   Yoong-Chert Foo
  49.                   Black Artist / Heretics
  50.                   5th September 1994
  51.  
  52. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  53.  
  54.         this requires a 386 as it uses a couple of 386 instructions, but it
  55.         could very easily be converted for 286 or even 8088 instructions if
  56.         you were very, very bored and poor :)
  57.  
  58.         a VGA is mandatory, and if you want to hear some music you need
  59.         something capable of producing Adlib FM sounds - btw SBOS works but
  60.         some bits sound out of tune
  61.  
  62.         everything is done by me apart from the music system [chicken] and
  63.         the music [?? - came with HSC tracker]
  64.  
  65.         quick greetings to the cool ppl on IRC - you know who you are :-)
  66.  
  67.         for smallest size, link with microsoft link and use /e
  68.  
  69. $
  70.  
  71. display "DO NOT ASSEMBLE WITH TASM 4.0!!!!!! (will crash)"
  72.  
  73. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  74.  
  75.  
  76. .386
  77. model compact
  78.  
  79. extrn _hscplayer:far
  80.  
  81. assume cs:only,ds:nothing,es:nothing,fs:nothing,gs:nothing
  82.  
  83. screenwidth     equ     144
  84. screenstart     equ     129*screenwidth
  85.  
  86. stack 128
  87.  
  88. ;─────────────────────────────────────────────────────────────────────────────
  89. p1              segment para use16
  90. p1buf           label   byte
  91.                 include back1.db
  92.                 db      screenwidth*152 dup (?)
  93. p1              ends
  94. ;─────────────────────────────────────────────────────────────────────────────
  95. p2              segment para use16
  96. p2buf           label   byte
  97.                 include back2.db
  98.                 db      screenwidth*152 dup (?)
  99. p2              ends
  100. ;─────────────────────────────────────────────────────────────────────────────
  101. p3              segment para use16
  102. p3buf           label   byte
  103.                 include back3.db
  104.                 db      screenwidth*152 dup (?)
  105. p3              ends
  106. ;─────────────────────────────────────────────────────────────────────────────
  107. p4              segment para use16
  108. p4buf           label   byte
  109.                 include back4.db
  110.                 db      (screenwidth*152-768-24) dup (?)
  111. palette         label   word
  112.                 db      0,0,0
  113.                 i=0
  114.                 rept    15
  115.                 db      i*3+18,i*2+18,0
  116.                 i=i+1
  117.                 endm
  118.                 i=0
  119.                 rept    64
  120.                 db      0,0,i
  121.                 i=i+1
  122.                 endm
  123.                 i=0
  124.                 rept    32
  125.                 db      i,0,63
  126.                 i=i+2
  127.                 endm
  128.                 i=0
  129.                 rept    64
  130.                 db      63,i,63-i
  131.                 i=i+1
  132.                 endm
  133.                 i=0
  134.                 rept    64
  135.                 db      63,63,i+16
  136.                 i=i+1
  137.                 endm
  138.                 db      16 dup (63,63,63)
  139. xdata           db      5fh,4fh,50h,82h,54h,80h,0dh,3eh,00h,01h,00h,00h
  140.                 db      73h,0ffh,00h,00h,0eah,8ch,0dfh,48h,00h,0e7h,06h,0e3h
  141. p4              ends
  142. ;─────────────────────────────────────────────────────────────────────────────
  143. music           segment use16
  144. muzak           label   byte
  145. include         music.db
  146. music           ends
  147. ;─────────────────────────────────────────────────────────────────────────────
  148.  
  149. only            segment use16
  150.  
  151. planesegs       label   word
  152. p1bufseg        dw      seg     p1buf
  153. p2bufseg        dw      seg     p2buf
  154. p3bufseg        dw      seg     p3buf
  155. p4bufseg        dw      seg     p4buf
  156.  
  157. chardata        dw      ?,?
  158.  
  159.                 include lisa.db
  160.  
  161. ; ───────────────────────────General─Initialisation───────────────────────────
  162. bobinit         proc
  163.  
  164.                 mov     ax,13h
  165.                 int     10h
  166.  
  167.                 mov     dx,03c8h
  168.                 xor     al,al
  169.                 out     dx,al
  170.                 mov     cx,768
  171.                 inc     dx
  172. wipepal:        out     dx,al
  173.                 loop    wipepal
  174.  
  175.                 mov     dx,03c4h
  176.                 mov     ax,00604h
  177.                 out     dx,ax
  178.                 mov     ax,00100h
  179.                 out     dx,ax
  180.                 mov     dx,03c2h
  181.                 mov     al,0e3h
  182.                 out     dx,al
  183.                 mov     dx,03c4h
  184.                 mov     ax,00300h
  185.                 out     dx,ax
  186.  
  187.                 mov     dx,03d4h
  188.                 mov     al,11h
  189.                 out     dx,al
  190.                 inc     dx
  191.                 in      al,dx
  192.                 and     al,7fh
  193.                 out     dx,al
  194.  
  195.                 mov     dx,03d4h
  196.                 xor     al,al
  197.                 mov     ds,p4bufseg
  198.                 mov     si,offset xdata
  199.                 mov     cx,24
  200. xloop:          mov     ah,ds:[si]
  201.                 out     dx,ax
  202.                 inc     al
  203.                 inc     si
  204.                 loop    xloop
  205.  
  206.                 mov     dx,03c0h
  207.                 mov     al,10h
  208.                 out     dx,al
  209.                 mov     al,61h
  210.                 out     dx,al
  211.                 mov     al,013h
  212.                 out     dx,al
  213.                 mov     al,6
  214.                 out     dx,al
  215.  
  216.                 mov     ds,p4bufseg
  217.                 mov     si,offset palette
  218.                 mov     dx,03c8h
  219.                 xor     al,al
  220.                 out     dx,al
  221.                 mov     cx,768
  222.                 inc     dx
  223.                 rep     outsb
  224.  
  225.                 xor     bx,bx
  226. fillplane:      mov     ax,planesegs[bx]
  227.                 mov     ds,ax
  228.                 mov     es,ax
  229.                 mov     di,18
  230.                 mov     dh,7
  231. fillbuf:        xor     si,si
  232.                 mov     cx,56
  233. fillline:       movsd
  234.                 movsd
  235.                 movsd
  236.                 movsd
  237.                 movsw
  238.                 add     si,screenwidth-18
  239.                 add     di,screenwidth-18
  240.                 loop    fillline
  241.                 sub     di,56*screenwidth-18
  242.                 dec     dh
  243.                 jnz     fillbuf
  244.                 xor     si,si
  245.                 mov     di,56*screenwidth
  246.                 mov     cx,5472
  247.                 rep     movsd
  248.                 inc     bx
  249.                 inc     bx
  250.                 cmp     bx,8
  251.                 jb      fillplane
  252.  
  253.                 mov     ax,1102h
  254.                 mov     dx,3c4h
  255.                 out     dx,ax
  256.                 mov     bx,1104h
  257.                 mov     ax,0a000h
  258.                 mov     es,ax
  259.                 xor     bp,bp
  260. copyplane:      mov     ds,planesegs[bp]
  261.                 mov     dl,7
  262.                 mov     di,16*screenwidth
  263. copyrow:        xor     si,si
  264.                 mov     cx,2016
  265.                 rep     movsd
  266.                 dec     dl
  267.                 jnz     copyrow
  268.                 xor     si,si
  269.                 mov     cx,1440
  270.                 rep     movsd
  271.  
  272.                 dec     bl
  273.                 jz      copied
  274.                 rol     bh,1
  275.                 mov     al,bh
  276.                 mov     dx,03c5h
  277.                 out     dx,al
  278.                 inc     bp
  279.                 inc     bp
  280.                 jmp     copyplane
  281. copied:
  282.  
  283.  
  284.                 mov     ax,1130h
  285.                 mov     bh,6
  286.                 int     10h
  287.                 mov     chardata,bp
  288.                 mov     chardata+2,es
  289.  
  290.                 ret
  291.  
  292. bobinit         endp
  293.  
  294.  
  295. ; ┌────────────────────────────Write─8*16─Char───────────────────────────────
  296. ; │ writechar wants : es:di -> offset
  297. ; │                   ds:si -> chardata
  298. ; │                   bx -> character
  299.  
  300. planesel        db      ?
  301. counter         db      ?
  302.  
  303. writechar       proc
  304.  
  305.                 shl     bx,4
  306.  
  307.                 mov     ax,1102h
  308.                 mov     dx,03c4h
  309.                 out     dx,ax
  310.                 mov     word ptr planesel,0411h
  311.                 xor     bp,bp
  312.                 mov     dx,8008h
  313.  
  314. writeplane:     xor     ax,ax
  315.                 test    byte ptr ds:[si+bx],dl
  316.                 jz      clear1
  317.                 mov     ah,bl
  318. clear1:         test    byte ptr ds:[si+bx],dh
  319.                 jz      clear2
  320.                 mov     al,bl
  321. clear2:         and     ax,0f0fh
  322.                 mov     word ptr es:[di+bp],ax
  323.                 inc     bx
  324.                 add     bp,screenwidth
  325.                 cmp     bp,16*screenwidth
  326.                 jb      writeplane
  327.  
  328.                 dec     counter
  329.                 jz      allwritten
  330.                 shr     dx,1
  331.                 mov     bp,dx
  332.                 sub     bx,16
  333.                 rol     planesel,1
  334.                 mov     dx,03c5h
  335.                 mov     al,planesel
  336.                 out     dx,al
  337.                 mov     dx,bp
  338.                 xor     bp,bp
  339.                 jmp     writeplane
  340.  
  341. allwritten:     ret
  342.  
  343. writechar       endp
  344.  
  345.  
  346. ; ┌──────────────────────────────Draw─Bob─Routine────────────────────────────
  347. ; │ Bob wants : dx -> x value
  348. ; │             bx -> y value * screenwidth
  349. ; │            eax -> add value
  350.  
  351. drawbob         proc
  352.  
  353.                 mov     cx,dx
  354.                 shr     dx,1
  355.                 jc      @1or3
  356.                 shr     dx,1
  357.                 jc      @2
  358.                 mov     ds,p1bufseg
  359.                 mov     es,p2bufseg
  360.                 mov     fs,p3bufseg
  361.                 mov     gs,p4bufseg
  362.                 xor     si,si
  363.                 xor     di,di
  364.                 jmp     @shadein
  365.                 
  366. @2:             mov     ds,p3bufseg
  367.                 mov     es,p4bufseg
  368.                 mov     fs,p1bufseg
  369.                 mov     gs,p2bufseg
  370.                 mov     si,1
  371.                 mov     di,1    
  372.                 jmp     @shadein
  373.  
  374. @1or3:          shr     dx,1
  375.                 jc      @3
  376.                 mov     ds,p2bufseg
  377.                 mov     es,p3bufseg
  378.                 mov     fs,p4bufseg
  379.                 mov     gs,p1bufseg
  380.                 xor     si,si
  381.                 mov     di,1
  382.                 jmp     @shadein
  383.                 
  384. @3:             mov     ds,p1bufseg
  385.                 mov     es,p2bufseg
  386.                 mov     fs,p3bufseg
  387.                 mov     gs,p4bufseg
  388.                 xor     si,si
  389.                 mov     di,-1
  390.                 inc     dl
  391.                                 
  392. @shadein:       add     bx,dx
  393.  
  394.                 add     dword ptr ds:[bx],eax
  395.                 add     dword ptr es:[bx],eax
  396.                 add     dword ptr fs:[bx+si],eax
  397.                 add     dword ptr gs:[bx+di],eax
  398.  
  399.                 add     dword ptr ds:[bx+screenwidth],eax
  400.                 add     dword ptr es:[bx+screenwidth],eax
  401.                 add     dword ptr fs:[bx+si+screenwidth],eax
  402.                 add     dword ptr gs:[bx+di+screenwidth],eax
  403.  
  404.                 add     dword ptr ds:[bx+screenwidth*2],eax
  405.                 add     dword ptr es:[bx+screenwidth*2],eax
  406.                 add     dword ptr fs:[bx+si+screenwidth*2],eax
  407.                 add     dword ptr gs:[bx+di+screenwidth*2],eax
  408.  
  409.                 add     dword ptr ds:[bx+screenwidth*3],eax
  410.                 add     dword ptr es:[bx+screenwidth*3],eax
  411.                 add     dword ptr fs:[bx+si+screenwidth*3],eax
  412.                 add     dword ptr gs:[bx+di+screenwidth*3],eax
  413.  
  414.                 add     dword ptr ds:[bx+screenwidth*4],eax
  415.                 add     dword ptr es:[bx+screenwidth*4],eax
  416.                 add     dword ptr fs:[bx+si+screenwidth*4],eax
  417.                 add     dword ptr gs:[bx+di+screenwidth*4],eax
  418.  
  419.                 add     dword ptr ds:[bx+screenwidth*5],eax
  420.                 add     dword ptr es:[bx+screenwidth*5],eax
  421.                 add     dword ptr fs:[bx+si+screenwidth*5],eax
  422.                 add     dword ptr gs:[bx+di+screenwidth*5],eax
  423.  
  424.                 add     dword ptr ds:[bx+screenwidth*6],eax
  425.                 add     dword ptr es:[bx+screenwidth*6],eax
  426.                 add     dword ptr fs:[bx+si+screenwidth*6],eax
  427.                 add     dword ptr gs:[bx+di+screenwidth*6],eax
  428.  
  429.                 add     dword ptr ds:[bx+screenwidth*7],eax
  430.                 add     dword ptr es:[bx+screenwidth*7],eax
  431.                 add     dword ptr fs:[bx+si+screenwidth*7],eax
  432.                 add     dword ptr gs:[bx+di+screenwidth*7],eax
  433.  
  434.                 add     dword ptr ds:[bx+screenwidth*8],eax
  435.                 add     dword ptr es:[bx+screenwidth*8],eax
  436.                 add     dword ptr fs:[bx+si+screenwidth*8],eax
  437.                 add     dword ptr gs:[bx+di+screenwidth*8],eax
  438.  
  439.                 add     dword ptr ds:[bx+screenwidth*9],eax
  440.                 add     dword ptr es:[bx+screenwidth*9],eax
  441.                 add     dword ptr fs:[bx+si+screenwidth*9],eax
  442.                 add     dword ptr gs:[bx+di+screenwidth*9],eax
  443.  
  444.                 add     dword ptr ds:[bx+screenwidth*10],eax
  445.                 add     dword ptr es:[bx+screenwidth*10],eax
  446.                 add     dword ptr fs:[bx+si+screenwidth*10],eax
  447.                 add     dword ptr gs:[bx+di+screenwidth*10],eax
  448.  
  449.                 add     dword ptr ds:[bx+screenwidth*11],eax
  450.                 add     dword ptr es:[bx+screenwidth*11],eax
  451.                 add     dword ptr fs:[bx+si+screenwidth*11],eax
  452.                 add     dword ptr gs:[bx+di+screenwidth*11],eax
  453.  
  454.                 add     dword ptr ds:[bx+screenwidth*12],eax
  455.                 add     dword ptr es:[bx+screenwidth*12],eax
  456.                 add     dword ptr fs:[bx+si+screenwidth*12],eax
  457.                 add     dword ptr gs:[bx+di+screenwidth*12],eax
  458.  
  459.                 add     dword ptr ds:[bx+screenwidth*13],eax
  460.                 add     dword ptr es:[bx+screenwidth*13],eax
  461.                 add     dword ptr fs:[bx+si+screenwidth*13],eax
  462.                 add     dword ptr gs:[bx+di+screenwidth*13],eax
  463.  
  464.                 add     dword ptr ds:[bx+screenwidth*14],eax
  465.                 add     dword ptr es:[bx+screenwidth*14],eax
  466.                 add     dword ptr fs:[bx+si+screenwidth*14],eax
  467.                 add     dword ptr gs:[bx+di+screenwidth*14],eax
  468.  
  469.                 add     dword ptr ds:[bx+screenwidth*15],eax
  470.                 add     dword ptr es:[bx+screenwidth*15],eax
  471.                 add     dword ptr fs:[bx+si+screenwidth*15],eax
  472.                 add     dword ptr gs:[bx+di+screenwidth*15],eax
  473.  
  474.                 cmp     di,-1
  475.                 jne     @drawin
  476.                 dec     bx
  477.  
  478. @drawin:        mov     ax,1102h
  479.                 and     cx,3
  480.                 shl     ah,cl
  481.                 mov     bp,cx
  482.                 shl     bp,1
  483.                 mov     dx,03c4h
  484.                 out     dx,ax
  485.  
  486.                 mov     ch,ah
  487.                 mov     cl,4
  488.                 mov     ax,0a000h
  489.                 mov     es,ax
  490.                 mov     di,bx
  491.  
  492. @copyplane:     mov     ds,planesegs[bp]
  493.                 mov     eax,dword ptr ds:[di]
  494.                 mov     dword ptr es:[di+screenstart],eax
  495.                 mov     eax,dword ptr ds:[di+screenwidth]
  496.                 mov     dword ptr es:[di+screenstart+screenwidth],eax
  497.                 mov     eax,dword ptr ds:[di+screenwidth*2]
  498.                 mov     dword ptr es:[di+screenstart+screenwidth*2],eax
  499.                 mov     eax,dword ptr ds:[di+screenwidth*3]
  500.                 mov     dword ptr es:[di+screenstart+screenwidth*3],eax
  501.                 mov     eax,dword ptr ds:[di+screenwidth*4]
  502.                 mov     dword ptr es:[di+screenstart+screenwidth*4],eax
  503.                 mov     eax,dword ptr ds:[di+screenwidth*5]
  504.                 mov     dword ptr es:[di+screenstart+screenwidth*5],eax
  505.                 mov     eax,dword ptr ds:[di+screenwidth*6]
  506.                 mov     dword ptr es:[di+screenstart+screenwidth*6],eax
  507.                 mov     eax,dword ptr ds:[di+screenwidth*7]
  508.                 mov     dword ptr es:[di+screenstart+screenwidth*7],eax
  509.                 mov     eax,dword ptr ds:[di+screenwidth*8]
  510.                 mov     dword ptr es:[di+screenstart+screenwidth*8],eax
  511.                 mov     eax,dword ptr ds:[di+screenwidth*9]
  512.                 mov     dword ptr es:[di+screenstart+screenwidth*9],eax
  513.                 mov     eax,dword ptr ds:[di+screenwidth*10]
  514.                 mov     dword ptr es:[di+screenstart+screenwidth*10],eax
  515.                 mov     eax,dword ptr ds:[di+screenwidth*11]
  516.                 mov     dword ptr es:[di+screenstart+screenwidth*11],eax
  517.                 mov     eax,dword ptr ds:[di+screenwidth*12]
  518.                 mov     dword ptr es:[di+screenstart+screenwidth*12],eax
  519.                 mov     eax,dword ptr ds:[di+screenwidth*13]
  520.                 mov     dword ptr es:[di+screenstart+screenwidth*13],eax
  521.                 mov     eax,dword ptr ds:[di+screenwidth*14]
  522.                 mov     dword ptr es:[di+screenstart+screenwidth*14],eax
  523.                 mov     eax,dword ptr ds:[di+screenwidth*15]
  524.                 mov     dword ptr es:[di+screenstart+screenwidth*15],eax
  525.  
  526.                 dec     cl
  527.                 jz      @alldone
  528.                 rol     ch,1
  529.                 mov     dx,03c5h
  530.                 mov     al,ch
  531.                 out     dx,al
  532.                 cmp     al,12h
  533.                 inc     bp
  534.                 inc     bp
  535.                 jnc     @copyplane
  536.                 inc     di
  537.                 xor     bp,bp
  538.                 jmp     @copyplane
  539. @alldone:       ret
  540.  
  541. drawbob         endp
  542.  
  543. ; ┌──────────────────────────Set─Window─Location──────────────────────────────
  544. ; │ SetWindow needs   cx-->x
  545. ; │                   dx-->y * screenwidth
  546.  
  547. setwindow       proc
  548.                 mov     bx,cx
  549.                 shr     cx,2
  550.                 add     cx,dx
  551.  
  552.                 mov     dx,03dah
  553. @setwindowsync: in      al,dx
  554.                 and     al,08h
  555.                 jnz     @setwindowsync
  556.  
  557.                 mov     dx,03d4h
  558.                 mov     al,00dh
  559.                 mov     ah,cl
  560.                 out     dx,ax
  561.  
  562.                 dec     al
  563.                 ;mov     al,00ch
  564.                 mov     ah,ch
  565.                 out     dx,ax
  566.  
  567.                 mov     dx,03dah
  568. @ksyncagain:    in      al,dx
  569.                 and     al,08h
  570.                 jz      @ksyncagain
  571.  
  572.                 mov     dx,03c0h
  573.                 mov     al,033h
  574.                 out     dx,al
  575.  
  576.                 mov     al,bl
  577.                 and     al,3
  578.                 shl     al,1
  579.                 out     dx,al
  580.  
  581.                 ret
  582.  
  583. setwindow       endp
  584.  
  585.  
  586. ; ──────────────────────────────Main─Variables─────────────────────────────────
  587. anglex          dw      0
  588. angley          dw      0
  589. backx           dw      0
  590. backy           dw      0
  591. viewx           dw      0
  592. viewy           dw      0
  593. coeffxdir       dw      1
  594. coeffydir       dw      -1
  595. coeffx          dw      2      ;starting rate of change in x
  596. coeffy          dw      3      ;starting rate of change in y
  597. bobcounter      dw      0
  598. jerkbits        equ     7
  599. ; ────────────────────────────Parameters─for─Bob───────────────────────────────
  600. coeffxmax       equ     4      ;max rate of change of x
  601. coeffymax       equ     5      ;max rate of change of y
  602. boblength       equ     450    ;length of Bob in squares
  603. viewdelay       equ     32     ;how many squares behind Bob's head camera views
  604. fastjerkbits    equ     7      ;how many squares drawn per scroll (70Hz)-fast
  605. slowjerkbits    equ     3      ;how many squares drawn per scroll (70Hz)-slow
  606. patternlength   equ     2800   ;5secs*8jerks*70fps
  607. ;  40characters wide -   0123456789012345678901234567890123456789
  608. message         db      'Liquid Metal  +61∙7∙201∙5242  28k824hrs'
  609.                 db      ' ■ Heretics WHQ ■ Sysop: Chuck Biscuits '
  610.                 db      'Australia''s best demoboard - Aust HQ for'
  611.                 db      'KLF  EMF  Iguana/VangeliSTeam  Admire'
  612.                 db      'Psychic Monks  Mental Design  sYmptom '
  613.                 db      'Surprise! Prod.  VLA  Digital Infinity'
  614.                 db      '  distro site for Inertia Player  DMP  '
  615.                 db      'iCE member board  DiE ANSi member board'
  616.                 db      'This Adv 100% ASM by Black Artist 5∙9∙94'
  617.                 db      '& uses HSC-Tracker by Chicken (<-greetz)'
  618. messagelength   equ     $-message
  619. signoff         db      'Call Liquid Metal: +61∙7∙201∙5242  28k8 All Hours - Australia''s finest demoboard',0ah,0dh
  620.                 db      '  ■ Heretics WHQ ■   Sysop: Chuck Biscuits [Heretics/iCE/Dissonance Co-Editor]',0ah,0dh,0ah,0dh
  621.                 db      'this BBS Advertisement v1.10 coded by Black Artist/Heretics,  5th September 1994',0ah,0dh
  622.                 db      '$'
  623.  
  624.  
  625. messagecount    dw      0
  626. ; ──────────────────────────────Main─Procedure─────────────────────────────────
  627. main            proc
  628.                 
  629.                 call    bobinit
  630.                 
  631.                 mov     ah,4
  632.                 xor     bx,bx
  633.                 call    _hscplayer
  634.                 mov     ax,seg muzak
  635.                 mov     es,ax
  636.                 mov     si,offset muzak
  637.                 xor     ah,ah
  638.                 mov     bx,0101h
  639.                 call    _hscplayer
  640.  
  641.                 lds     si,dword ptr chardata
  642.                 mov     ax,0a000h
  643.                 mov     es,ax
  644.                 mov     cx,40
  645.                 xor     di,di
  646. wipeline:       mov     bx,'█'
  647.                 call    writechar
  648.                 inc     di
  649.                 inc     di
  650.                 loop    wipeline
  651.  
  652. keepgoing:      cmp     bobcounter,64
  653.                 ja      dontslideon
  654.                 mov     bx,bobcounter
  655.                 shr     bx,1
  656.                 mov     ax,0e418h
  657.                 sub     ah,bl
  658.                 mov     dx,03d4h
  659.                 out     dx,ax
  660. dontslideon:    cmp     bobcounter,patternlength-512
  661.                 jb      dontslideoff
  662.                 mov     bx,bobcounter
  663.                 sub     bx,patternlength-512
  664.                 shr     bx,4
  665.                 mov     ax,0c418h
  666.                 add     ah,bl
  667.                 mov     dx,03d4h
  668.                 out     dx,ax
  669.  
  670. dontslideoff:   cmp     bobcounter,patternlength-boblength
  671.                 jae     dontdraw
  672.                 mov     si,cs:[anglex]
  673.                 movzx   dx,lisax[si]
  674.                 add     dx,153
  675.                 mov     si,cs:[angley]
  676.                 mov     al,screenwidth
  677.                 mul     lisay[si]
  678.                 mov     bx,ax
  679.                 mov     eax,02020202h
  680.                 call    drawbob
  681.  
  682.                 mov     ax,cs:[anglex]
  683.                 add     ax,coeffx
  684.                 cmp     ax,1256
  685.                 jb      @nomodx
  686.                 sub     ax,1256
  687. @nomodx:        mov     cs:[anglex],ax
  688.                 mov     ax,cs:[angley]
  689.                 add     ax,coeffy
  690.                 cmp     ax,1256
  691.                 jb      @nomody
  692.                 sub     ax,1256
  693. @nomody:        mov     cs:[angley],ax
  694.  
  695. dontdraw:       mov     ax,jerkbits
  696.                 test    bobcounter,ax
  697.                 jnz     noview
  698.  
  699.                 mov     ah,1
  700.                 call    _hscplayer
  701.  
  702.                 mov     si,cs:[viewx]
  703.                 movzx   cx,lisax[si]
  704.                 mov     si,cs:[viewy]
  705.                 mov     al,screenwidth
  706.                 mul     lisay[si]
  707.                 mov     dx,16*screenwidth
  708.                 add     dx,ax
  709.                 call    setwindow
  710.  
  711. noview:         cmp     bobcounter,viewdelay
  712.                 jb      dontmove
  713.                 cmp     bobcounter,patternlength-boblength+viewdelay
  714.                 jae     dontmove
  715.                 mov     ax,cs:[viewx]
  716.                 add     ax,coeffx
  717.                 cmp     ax,1256
  718.                 jb      @nomodvx
  719.                 sub     ax,1256
  720. @nomodvx:       mov     cs:[viewx],ax
  721.                 mov     ax,cs:[viewy]
  722.                 add     ax,coeffy
  723.                 cmp     ax,1256
  724.                 jb      @nomodvy
  725.                 sub     ax,1256
  726. @nomodvy:       mov     cs:[viewy],ax
  727.  
  728. dontmove:       cmp     bobcounter,boblength
  729.                 jb      notyet
  730.                 mov     si,cs:[backx]
  731.                 movzx   dx,lisax[si]
  732.                 add     dx,153
  733.                 mov     si,cs:[backy]
  734.                 mov     al,screenwidth
  735.                 mul     lisay[si]
  736.                 mov     bx,ax
  737.                 mov     eax,-02020202h
  738.                 call    drawbob
  739.  
  740.                 mov     ax,cs:[backx]
  741.                 add     ax,coeffx
  742.                 cmp     ax,1256
  743.                 jb      @nomodbx
  744.                 sub     ax,1256
  745. @nomodbx:       mov     cs:[backx],ax
  746.                 mov     ax,cs:[backy]
  747.                 add     ax,coeffy
  748.                 cmp     ax,1256
  749.                 jb      @nomodby
  750.                 sub     ax,1256
  751. @nomodby:       mov     cs:[backy],ax
  752.  
  753. notyet:         inc     bobcounter
  754.                 cmp     bobcounter,patternlength
  755.                 jb      dontchange
  756.  
  757.                 mov     bobcounter,0
  758.  
  759.                 mov     ax,coeffx
  760.                 add     ax,coeffxdir
  761.                 jz      changexdir
  762.                 cmp     ax,coeffxmax
  763.                 jbe     dontchangexdir
  764. changexdir:     neg     coeffxdir
  765.                 add     ax,coeffxdir
  766.                 add     ax,coeffxdir
  767. dontchangexdir: mov     coeffx,ax
  768.                 mov     bx,ax
  769.  
  770.                 mov     ax,coeffy
  771.                 add     ax,coeffydir
  772.                 jz      changeydir
  773.                 cmp     ax,coeffymax
  774.                 jbe     dontchangeydir
  775. changeydir:     neg     coeffydir
  776.                 add     ax,coeffydir
  777.                 add     ax,coeffydir
  778. dontchangeydir: mov     coeffy,ax
  779.  
  780.                 lds     si,dword ptr chardata
  781.                 mov     ax,0a000h
  782.                 mov     es,ax
  783.                 mov     di,-screenwidth
  784.                 cmp     messagecount,messagelength
  785.                 jb      dontwrap
  786.                 mov     messagecount,0
  787. dontwrap:       mov     cx,40
  788.  
  789. nextchar:       mov     bp,messagecount
  790.                 movzx   bx,message[bp]
  791.                 call    writechar
  792.                 inc     di
  793.                 inc     di
  794.                 inc     messagecount
  795.                 loop    nextchar
  796.  
  797. dontchange:     in      al,60h
  798.                 cmp     al,1
  799.                 jne     keepgoing
  800.  
  801. outtahere:      mov     ax,3
  802.                 int     10h
  803.  
  804.                 mov     ah,2
  805.                 call    _hscplayer
  806.  
  807.                 mov     ax,cs
  808.                 mov     ds,ax
  809.                 mov     ah,9
  810.                 mov     dx,offset signoff
  811.                 int     21h
  812.                 mov     ax,4c00h
  813.                 int     21h
  814.                 
  815. main            endp               
  816.  
  817. only            ends
  818.           
  819. end             main
  820.